home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et-2_2.lha / et2.2 / src / ObjInt.h < prev    next >
C/C++ Source or Header  |  1990-11-28  |  897b  |  48 lines

  1. #ifndef ObjInt_First
  2. #ifdef __GNUG__
  3. #pragma once
  4. #endif
  5. #define ObjInt_First
  6.  
  7. #include "Object.h"
  8.  
  9. class ObjInt: public Object {
  10.     int val;
  11. public:
  12.     MetaDef(ObjInt);
  13.  
  14.     ObjInt(int v= 0)
  15.     { val= v; }
  16.  
  17.     int GetValue()                     
  18.     { return val; }
  19.     int SetValue(int newval)           
  20.     { val= newval; Changed(); return val; }
  21.     int operator= (int newval)
  22.     { return SetValue(newval); }
  23.     int operator++ ()
  24.     { return SetValue(GetValue()+1); }
  25.     int operator-- ()
  26.     { return SetValue(GetValue()-1); }
  27.     operator int()
  28.     { return val; }
  29.  
  30.     //---- comparing
  31.     unsigned long Hash ();
  32.     bool IsEqual (Object*);
  33.     int Compare (Object*);
  34.  
  35.     //---- converting
  36.     char* AsString();
  37.  
  38.     //---- activation passivation
  39.     ostream& PrintOn (ostream&s);
  40.     istream& ReadFrom(istream &);
  41.  
  42.     Object *DeepClone();
  43.     void InspectorId(char *, int);
  44. };
  45.  
  46. #endif ObjInt_First
  47.  
  48.